Lotfollah Dome

Lotfollah Dome 1.png
Figure 1: Lotfallah Dome. There are $32$ circles around the outer ring, and $32$ circles around every ring thereafter. Each circle is tangent to all of its neighbors. The key to construction is to find how much each successive ring is reduced.
Here we wish to arrange circles into a pattern similar to that found on the dome of Sheikh Lotfollah Mosque in Isfahan, Iran. The dome as seen from inside and below is a large circle made of many additional circles all tangent to each other. The finished picture is figure 1.

The problem can begin by defining a radius, $R$, for the largest ring. In this context, we are using 'ring' to mean a circle composed of circles. The 'largest ring' as seen in 1 is the one on the outer perimeter and made up of the largest small circles. Although we will later increase $R$ to something practical, we want to begin with $R=1$. Also, in order to exagerate the angles involved, we want to reduce the number of circles in ring $1$ to just eight circles. That is, $n=8$.

The center of one of the subcircles in the outer ring can be at $\left(\cos\frac{2\pi}{n},\sin\frac{2\pi}{n}\right).$ To get the adjacent subcircle, we just have to increment the angle by $\frac{2\pi}{n}$. Thus we have a sequence to locate all eight centers. $$\left[\begin{array}{c} x_{i}\\ y_{i} \end{array}\right]=\left[\begin{array}{c} \cos(\frac{2\pi}{n}+i)\\ \sin\frac{2\pi}{n}+i \end{array}\right]\quad i=0,\frac{2\pi}{n},\frac{4\pi}{n},\ldots,\frac{2(n-1)\pi}{n}$$ The expression is also equivalent to $$\left[\begin{array}{c} x_{i}\\ y_{i} \end{array}\right]=\left[\begin{array}{c} \cos(i\cdot\frac{2\pi}{n})\\ \sin(i\cdot\frac{2\pi}{n}) \end{array}\right]\quad i=0,1,2,\ldots,(n-1).$$ But that only finds the subcircle centers and to draw them, we also need their radii. Since they are tangent, we can just halve the distance between any two adjacent center points. However, if we look at figure 2, we can see that $s=sin(\pi/n)$ and more, that vector $\left\Vert \mathbf{v}\right\Vert =\cos(\pi/n).$

Lotfollah Dome 2.png
Figure 2: Graph of three subcircles when $n=8$, and the perimeter is set to $1$. The angle $\alpha$ is half the size of $2\pi/8$, and is accordingly labelled $\alpha=\pi/n$. That means that side $s$, which is the subcircle radius must be $\sin(\pi/n)$. Equally important is to note that the distance to point $D$, which is the magnitude of vector $\mathbf{v}$, must be $\cos(\pi/n)$

Now how do we begin to find the center points of the next ring going toward the origin? Since each ring of subcircles has the same number of circles as the prior one, we can intuit that they are reduced by a constant factor which we will name $r$. This is the same as saying that the concentric rings have radii that are constantly reduced by factor $r$, and that also means that the radius of the next inner ring will be $r\cdot s$ and that the radius of the ring after that will be $r\cdot r\cdot s$ and etc. But, how to find $r$. Looking at figure 2, we can see that a Pythagorean equation is available, $$\left(r\cdot s+s\right)^{2}=(\cos(\pi/n)-r)^{2}+s^{2}$$ Substituting for $s$, $$\left(r\cdot\sin(\pi/n)+\sin(\pi/n)\right)^{2}=(\cos(\pi/n)-r)^{2}+\sin(\pi/n)^{2}$$ and solving for $r$,letting $\alpha=\pi/n$. $$\text{reduction factor }r=\frac{-\cos\alpha-\sin^{2}\alpha\pm\sin\alpha\sqrt{\cos^{2}\alpha+2\cos\alpha+\sin^{2}\alpha}}{\sin^{2}\alpha-1}$$

Lotfollah Dome 3.png
Figure 3: The figure shows subcircle center point $E$, which can be found as $r\cdot\mathbf{v}$. However, finding $\mathbf{v}$ is not really necessary as point $E=r\cdot(\cos\alpha,\sin\alpha)$. The next point, $F$, the center of the adjacent subcircle, would be $F=r\cdot(\cos3\alpha,\sin3\alpha)$. The radius of these ring 2 subcircles is $r\cdot s$.

The listing here is just the loop for graphing this, written in javascript. Values for $R$, the radius of the largest ring, and $a=\alpha=\pi/n$ as well as $r$ and $s$ were defined before this loop.

for(let j=0; j<n; j++){
for(let i=0; i<n; i++){
//A=createVector(R*cos(i*2*a),R*sin(i*2*a));
A=createVector(r**j*R*cos(a*(2*i+j)),r**j*R*sin(a*(2*i+j)));
ellipse(A.x,A.y,2*r**j*s);
} //end for i
} //end for j

$\text{CenterPoints}=\left(r^{j}R\cos(2i+j),r^{j}R\sin(2i+j)\right)\quad j=0,\ldots,\left(n-1\right)\quad i=0,\ldots,\left(n-1\right)$